package com.iceframework.core.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.iceframework.core.activiti.service.ActivitiService;

public class ActivitiUtils {
	
	private static final Logger log = LoggerFactory.getLogger(ActivitiUtils.class);

	private static ActivitiService activitiService;
	
	static {
		if(activitiService == null) {
			activitiService = SpringContextUtils.getBean("activitiService", ActivitiService.class);
		}
	}
	
	/**
	 * 启动流程
	 * 
	 */
	public static String startProcesses(String type) {
		String processId = activitiService.startProcesses(type);
		log.info("启动流程成功，流程ID为："+processId);
		return processId;
	}
	
}